<!DOCTYPE html>
<HTML>

<head>
    <title></title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link href="../static/css/default.css?v=20191209" rel="stylesheet">
</head>

<body>

    <div class="pt-4 pb-4">
        <form class="form-horizontal layui-form mb60px" lay-filter="editFormFilter" action="javascript:;">
            <div class="form-group">
                <label class="col-sm-2 control-label">水印图片</label>
                <div class="col-sm-8">
                    <div id="WatermarkImage" class="uploadImg">
                        <div class="btnDiv">
                            <button type="button" class="layui-btn btn-secondary">
                                <i class="layui-icon">&#xe67c;</i>上传图片
                            </button>
                            <input type="hidden" name="WatermarkImage">
                        </div>
                        <div class="imgList clearfix">
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label"><i class="red">*</i>水印透明度</label>
                <div class="col-sm-8">
                    <input class="form-control" name="WatermarkAlpha" type="text" required lay-verify="required|alpha" placeholder="输入值在0到1之间" style="width: 100px;" />
                </div>
            </div>
            <div class="bottomSave">
                <button class="btn btn-primary w-25" type="submit" lay-submit lay-filter="editBtnFilter">保存</button>
            </div>
        </form>
    </div>

    <script src="../static/js/jquery-3.3.1.min.js"></script>
    <script src="../static/Plugins/bootstrap/js/bootstrap.min.js"></script>
    <script src="../static/Plugins/layui/layui.all.js"></script>
    <script src="../static/js/jquery-confirm.min.js"></script>
    <script src="../static/js/jquery-ext-user.js?v=20191209"></script>
    
    <script>
        $(function(){
            // 编辑器

            $.getdata('/clientApi/UserCompany/GetCompany', {}, function(data){
                form.val("editFormFilter", $.formData(data));
                // 水印图片 图片
                $.image({
                    id: 'WatermarkImage',
                    path: data.WatermarkImage,
                });
                win.formFocus('editFormFilter');

                form.on("submit(editBtnFilter)", function (data) {
                    data.field.Type = 2;
                    $.postdata(
                        "/clientApi/UserCompany/UpdateCompany",
                        data.field,
                        function (res) {
                            if(res){
                                win.msg("更新成功");
                            }else{
                                win.alert('更新失败');
                            }
                        }
                    );
                    return false;
                });
            });
        });
    </script>
</body>

</HTML>